export interface AnyObject {
  [key: string]: unknown
}

export interface Options {
  value: unknown
  label: string
}

export interface NodeOptions extends Options {
  children?: NodeOptions[]
}

export interface GetParams {
  body: null
  type: string
  url: string
}

export interface PostData {
  body: string
  type: string
  url: string
}

export interface Pagination {
  current: number
  pageSize: number
  total?: number
}

export type TimeRanger = [string, string]

export interface GeneralChart {
  xAxis: string[]
  data: Array<{ name: string; value: number[] }>
}

// 扩展excel类型，excel原生ts包DataValidations被注释掉了
// 具体issues https://github.com/exceljs/exceljs/issues/1109
declare module 'exceljs' {
  export interface DataValidations {
    add(range: string, validation: DataValidation): void
    readonly model: Record<string, DataValidation>
  }
  export interface Worksheet {
    dataValidations: DataValidations
  }
}

export type getArrayItemType<T> = T extends (infer U)[] ? U : never

export interface FileListType {
  fileId: string
  fileName: string
  fileUrl: string
}
